<#cenluan title="创建相册" validate="true">
    <ol class="breadcrumb">
        <li><a href="/gallery">相册</a></li>
        <li class="active">创建相册</li>
    </ol>
    <!--@if(!isEmpty(msg)){-->
    <div class="alert alert-danger">
        <button class="close" data-dismiss="alert">x</button>
        ${msg}
    </div>
    <!--@}-->
    <form action="/gallery/save" class="form-horizontal" method="post">
        ${token}
        <div class="form-group">
            <label class="control-label col-md-2">标题</label>

            <div class="col-md-5">
                <input type="text" class="form-control" name="gallery.title"
                       minlength="2" maxlength="32" required placeholder="3-32个字"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">密码</label>

            <div class="col-md-5">
                <input type="text" class="form-control" name="gallery.pwd" maxlength="6" minlength="6"
                       placeholder="6位数字"/>

                <p class="help-block">设置了密码的相册可以让别人参与，小伙伴凭相册密码即可加入</p>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">简介</label>

            <div class="col-md-5">
						<textarea style="resize:vertical" class="form-control" name="gallery.intro"
                                  maxlength="500" placeholder="500字以内"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3 col-md-offset-2">
                <button class="btn btn-primary btn-block" type="submit">
                    提交&nbsp;<span class="glyphicon glyphicon-ok"></span>
                </button>
            </div>
        </div>

    </form>
    <script type="text/javascript">
        $("form").validate({
            rules: {
                "gallery.pwd": {
                    digits: true
                }
            },
            submitHandler: function (form) {
                $(form).find(":submit").button("loading");
                form.submit();
            }

        });
    </script>
</#cenluan>